<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
    <head>
        <jsp:include page="../WEB-INF/jspf/header.jsp" >
            <jsp:param name="title" value="All Books" />
        </jsp:include>
    </head>
    <body>
        <jsp:include page="../WEB-INF/jspf/beforeWork.jsp" >
            <jsp:param name="allBooks" value="" />
        </jsp:include>

        <h3>List of books</h3>
        <table border="1">
            <c:forEach items="${books}" var="book">
                <tr>
                    <td><c:out value="${book.name}" default="" /></td>
                    <td><c:out value="${book.author.surname}" default="" /></td>
                    <td><fmt:formatDate value ="${book.published}" pattern="MM-dd-yyyy" /></td>
                    <td><c:out value="${book.fiction}" default="" /></td>
                </tr>
            </c:forEach>
        </table>
        
        <jsp:include page="../WEB-INF/jspf/afterWork.jsp" />
    </body>
</html>
